home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / Hack / MISC / HTC31.ZIP / HOWTO3_1.TXT
Encoding:
Text File  |  1996-05-18  |  5.7 KB  |  114 lines

  1.  
  2.             HOW TO CRACK, A TUTORIAL - LESSON 3 (1)
  3.                  by +ORC (the old red cracker)
  4.  
  5. How to crack, an approach                         LESSON 1
  6. How to crack, tools and tricks of the trade       LESSON 2
  7. -> How to crack, hands onn, paper protections     LESSON 3 (1/2)
  8. How to crack, hands on, time limits               LESSON 4
  9. How to crack, hands on, disk-CDrom access         LESSON 5
  10. How to crack, funny tricks                        LESSON 6 (1/2)
  11. How to crack, intuition and luck                  LESSON 7
  12. How to crack windows, an approach                 LESSON 8
  13. How to crack windows, tools of the trade          LESSON 9
  14. How to crack, advanced cracking                   LESSON A (1/2)
  15. How to crack, zen-cracking                        LESSON B
  16. How to crack, cracking as an art                  LESSON C
  17. How to crack                                      INDEX
  18.  
  19. LESSON 3 (1)
  20. HOW TO CRACK, HANDS ON - Password protected programs
  21.  
  22. SOME PROBLEMS WITH INTEL's INT
  23. The INT instruction is the source of a great deal of the
  24. flexibility in the PC architecture, because the ability to get
  25. and set interrupt vectors means that system services (included
  26. DOS itself) are infinitely extensible, replaceable and
  27. MONITORABLE. Yet the Int instruction is also remarkably
  28. inflexible in two key ways:
  29. -    an interrupt handler DOES NOT KNOW which interrupt number
  30.      invoked it.
  31. -    the int instruction itself expects an IMMEDIATE operand:
  32.      you cannot write MOV AX,x21, and then INT AX; you must
  33.      write INT x21.
  34. That would be very good indeed for us cracker... unfortunately
  35. many high level language compilers compile interrupts into PUSHF
  36. and FAR CALL instruction sequences, rather than do an actual INT.
  37. Another method is to PUSH the address of the handler on the stack
  38. and do RETF to it. 
  39.      Some protection schemes attempt to disguise interrupt calls,
  40. this is particularly frequent in the disk access protection
  41. schemes (-> see LESSON 5) that utilize INT_13 (the "disk"
  42. interrupt).
  43.      If you are attempting to crack such programs, the usual
  44. course of action is to search for occurrences of "CD13", which
  45. is machine language for interrupt 13. One way or another, the
  46. protection scheme will have to use this interrupt to check for
  47. the special sectors of the disk. If you examine a cross section
  48. of the program, however, you 'll find programs which do not have
  49. "CD13" in their machine code, but which clearly are checking the
  50. key disk for weird sectors. How comez?
  51.      There are several techniques which can be used to camouflage
  52. the protection scheme from our nice prying eyes. I'll describe
  53. here the three such techniques that are more frequent:
  54. 1)   The following section of code is equivalent to issuing an
  55. INT 13 command to read one sector from drive A, side 0, track
  56. 29h, sector ffh, and then checking for a status code of 10h:
  57.      cs:1000   MOV  AH,02     ;read operation
  58.      cs:1002   MOV  AL,01     ;1 sector to read
  59.      cs:1004   MOV  CH,29     ;track 29h
  60.      cs:1006   MOV  CL,FF     ;sector ffh
  61.      cs:1008   MOV  DX,0000   ;side 0, drive A
  62.      cs:100B   XOR  BX,BX     ;move 0...
  63.      cs:100D   MOV  DS,BX     ;...to DS register
  64.      cs:100F   PUSHF          ;pusha flags
  65.      cs:1010   PUSH CS        ;pusha CX
  66.      cs:1011   CALL 1100      ;push address for next
  67.                               instruction onto stack and branch
  68.      cs:1014   COMP AH,10     ;check CRC error
  69.      cs:1017   ... rest of verification code
  70.      ...
  71.      ...
  72.      cs:1100   PUSHF          ;pusha flags
  73.      cs:1101   MOV  BX,004C   ;address of INT_13 vector
  74.      cs:1104   PUSH [BX+02]   ;push CS of INT_13 routine
  75.      cs:1107   PUSH [BX]      ;push IP of INT_13 routine
  76.      cs:1109   IRET           ;pop IP,CS and flags
  77. Notice that there is no INT 13 command in the source code, so if
  78. you had simply used a debugger to search for "CD13" in the
  79. machine code, you would never have found the protection routine.
  80.  
  81. 2)   Another technique is to put in a substitute interrupt
  82. instruction, such as INT 10, which looks harmless enough, and
  83. have the program change the "10" to "13 (and then back to "10")
  84. on the fly. A search for "CD13" would turn up nothing.
  85.  
  86. 3)   The best camouflage method for interrupts I have ever
  87. cracked (albeit not on a INT 13) was a jump to a section of the
  88. PROGRAM code that reproduces in extenso the interrupt code. This
  89. elegant (if a little overbloated) disguise mocks every call to
  90. the replicated interrupt.
  91. Bear all this in mind learning the following cracks.
  92.                                                               
  93. CRACKING PASSWORD PROTECTED PROGRAMS
  94.      Refer to lesson one in order to understand why we are using
  95. games instead of commercial applications as learn material: they
  96. offer the same protection used by the more "serious" applications
  97. (or BBS & servers) although inside files that are small enough
  98. to be cracked without loosing too much time.
  99.      A whole series of programs employ copy protection schemes
  100. based upon the possess of the original manual or instructions.
  101. That's obviously not a very big protection -per se- coz everybody
  102. nowadays has access to a photocopier, but it's bothering enough
  103. to motivate our cracks and -besides- you'll find the same schemes
  104. lurking in many other password protected programs. 
  105.      Usually, at the beginning of the program, a "nag screen"
  106. requires a word that the user can find somewhere inside the
  107. original manual, something like: "please type in the first word
  108. of line 3 of point 3.3.2". Often, in order to avoid mistakes, the
  109. program indicates the first letter of the password... the user
  110. must therefore only fill the remaining letters.
  111.  
  112. Some examples, some cracks:
  113.  
  114.